package com.algo.pattern.observable.observable;

import com.algo.pattern.observable.model.StockUpdateResult;

import java.util.Observable;
import java.util.Observer;

/**
 * 库存更新观察者
 */
public class StockUpdateObserver implements Observer {

    @Override
    public void update(Observable observable, Object arg) {
        StockUpdateResult stockUpdateResult = (StockUpdateResult) arg;
        System.out.println("调度中心更新库存处理结束，messageId =" + stockUpdateResult.getMessageId()
                + ", 更新结果为：" + stockUpdateResult.getUpdateResult());
    }

}
